Skip to content

fix(cli): 0.10.12 — status, doctor and verify keep an older denial visible as dated history (port of staging #48) - #1943

Merged
jonathan308 merged 4 commits into
devfrom
fix/authorization-history
Nov 12, 2026
Merged

jonathan308 merged 4 commits into
devfrom
fix/authorization-history

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Ready for review, for 0.10.12. Head b58b276f4f; CI (dev) run 42727580142: success. Independent review:
approve
(2026-11-09; on Mac A, ~/build/merge/mainnet/earnings/review-ports.md §4): the adaptation onto liveDecision/displayedStatus
is correct and disjoint, and verify's new exit rule changes only the new INFO row. Its one finding, a non-blocking
test gap (the status line and doctor's diagnosis row had no test), is closed by b58b276f4f: one test each, both
failing with their block removed. Red first, then green, both in CI (see Test plan); refactor pass done. Port of
jonathan308/d-inference-pr-staging#48 (2026-10-05), which never landed, adapted to dev's displayedStatus.

Summary

Issue #1163: a legacy-verified provider fell to authorization path none and got no requests while every diagnostic
said it was healthy. darkbloom status, doctor and verify show the coordinator's last authorization only while
it is at most 10 s old (snapshotMaxAge). Dev already keeps an unexpired App Attest lease visible past that
(displayedStatus), but an older none (a denial) or legacy report still vanishes, so a denied Mac can look healthy.

This keeps such a report visible as dated history, never as a grant:

  • status: Last reported authorization: received 10m ago; not a fresh dispatch grant. <summary>;
  • doctor and verify: a last reported authorization line, INFO for legacy and WARN for none, and the
    trust and public attestation checks still run after it;
  • verify now fails on a WARN or FAIL line, not on INFO (no other check is INFO).

Before

flowchart LR
  A["Running daemon, fresh snapshot, none or legacy report received 10 min ago"] --> B{"displayedStatus: receipt within 10 s, or an unexpired App Attest lease?"}
  B -- no --> C["status, doctor and verify: no authorization line"]
  C --> D["a denied Mac looks healthy"]
  classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
  class C,D bad
Loading

After

flowchart LR
  A["Running daemon, fresh snapshot, none or legacy report received 10 min ago"] --> B{"displayedStatus shows a decision?"}
  B -- yes --> C["serving authorization, as before"]
  B -- no --> E{"lastReportedStatus: same guards except the receipt age; path none or legacy?"}
  E -- yes --> F["Last reported authorization: received 10m ago; not a fresh dispatch grant"]
  F --> G["legacy INFO, none WARN; trust and public proof checks still run"]
  E -- "no: app_attest, unknown path, stale snapshot, other process or coordinator" --> H["nothing, as before"]
  classDef good fill:#dcfce7,stroke:#15803d,color:#14532d
  class F,G good
Loading

Code flow: ProviderAuthorizationReadiness.lastReportedStatus returns a decision only where displayedStatus returns
nil, through dev's liveDecision (snapshot write ≤ 10 s, process and coordinator identity, online, protocol 1, a
receipt after the process start and ≤ 2 s ahead), and only for none/legacy. DaemonState.lastReportedProviderAuthorization
binds it to the snapshot like displayedProviderAuthorization. Callers: StatusCommand (before the trust line),
DoctorRunner.networkDiagnosis (trust section), buildCoordinatorDoctorChecks (after the health check), and
Verify (isFailure(strict: true)).

Linked issue

Refs #1163 (diagnostic visibility only: not the serving failures, console labels or routing eligibility). Original:
jonathan308/d-inference-pr-staging#48 (private).

Test plan

  • Red first: the CLI tests are their own commit (09cc7be565) on dev 0f11fbe01a:
    agedReportKeepsAttestationLookup, agedReportNeverReplacesPublicProof and verifyAgedReports must fail there (no
    history row); agedReportGuards must pass on both. CI (dev) run 42679834358 on the red commit: failed exactly
    there
    , 16 issues in those three tests; agedReportGuards and the other 1,079 tests of that shard passed.
  • CI (dev) run 42683672750 on the fix 008ae270dd: success (both shards). ProviderAuthorizationReadinessTests
    gains nine tests of the new API.
  • Local (Xcode 27.2, CPU sandbox): DoctorCommandRunTests 14, ProviderAuthorizationReadinessTests 23,
    DoctorOperatorDiagnosisTests 5: pass.
  • make docs-check (211 files), docs-impact-check --base dev (10 files), changelog check, git diff --check: pass.
  • Refactor pass (08e7bca7b9), local: ProviderAuthorizationReadinessTests 23, DoctorCommandRunTests 14,
    DoctorOperatorDiagnosisTests|StatusCommandRunTests 11: pass. CI (dev) run 42707261438 on 08e7bca7b9:
    success.
  • After the review (b58b276f4f): StatusCommandRunTests.agedReportIsDatedHistory (an aged legacy and an aged
    none report print Last reported authorization: received 10m ago; … right before the trust line, and no
    Authorization:; received just now, Authorization: and no history) and
    DoctorOperatorDiagnosisTests.agedReportIsTrustHistory (the trust section's last reported authorization row, INFO or
    WARN with the exact text, before trust level, never serving authorization). Local: StatusCommandRunTests 7,
    DoctorOperatorDiagnosisTests 6, DoctorCommandRunTests 14: pass; with both blocks removed, exactly the two new tests
    fail. CI (dev) run 42727580142 on b58b276f4f: success.

Adapted from the original:

  • The original's diagnosticStatus returned the strict result when there was one; here lastReportedStatus returns
    only history, and the callers keep dev's displayedStatus for the current decision.
  • agedReportGuards: on dev an aged App Attest decision with an unexpired lease is still the serving authorization row
    (dev's rule), so the test pins that, and adds an expired lease, which is shown nowhere.

Components touched

  • provider-swift (Swift CLI)
  • docs

Protocol / interface changes

  • No protocol/interface changes. verify's exit code changes only for the new INFO line.

Documentation impact

  • docs/reference/provider-authorization.md (history, a table of where it shows), docs/provider/cli-reference.md;
    changelog.d/authorization-history.md.

Refactor pass

The original had independent design and refactor reviews. The port's independent refactor pass (2026-11-09,
08e7bca7b9): the adaptation onto liveDecision/displayedStatus is correct (for none/legacy the two are disjoint,
so no row shows twice; history never offers removal; the only INFO row verify can print is the new one). Cleanups:
buildCoordinatorDoctorChecks drops an authorization == nil ? guard that lastReportedStatus already guarantees
(the call stays beside the other two decisions from the same snapshot and time), and lastReportedPaths is private.
Left as is: the private ageDescription (it guards non-finite ages that DurationFormatting.compact would trap on) and
the legacy-INFO / none-WARN mapping in doctor's two sections (as dev's "serving authorization" level).

AI usage: ported by Claude Opus 5.5 (S-DINF sweep) at the owner's request. Not for merge until reviewed.

jonathan308 and others added 2 commits November 9, 2026 11:02
…ated history (red)

Port of jonathan308/d-inference-pr-staging#48's CLI tests onto dev
(issue #1163). A provider's last coordinator authorization report is shown
only while it is at most 10 s old (snapshotMaxAge); dev keeps an unexpired
App Attest lease past that (displayedStatus), but an older `none` (a denial)
or `legacy` report still disappears from status, doctor and verify, so a
denied Mac can look healthy.

- agedReportKeepsAttestationLookup and agedReportNeverReplacesPublicProof
  expect a "last reported authorization" row (INFO for legacy, WARN for
  none) beside the public attestation checks, which still run: they fail on
  dev, which prints no such row.
- verifyAgedReports expects verify to print that row and to fail only on a
  WARN or FAIL: it fails on dev.
- agedReportGuards pins what stays withheld (pre-start receipts, a stale
  snapshot, another coordinator) and, adapted to dev, that an aged App
  Attest decision is never history: an unexpired lease is still the serving
  authorization row (dev's displayedStatus), and an expired one is shown
  nowhere. It passes on dev and must keep passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rt as dated history

Port of jonathan308/d-inference-pr-staging#48 onto dev, for 0.10.12 (issue
#1163), adapted to dev's displayedStatus, which already keeps an unexpired
App Attest lease visible past snapshotMaxAge.

- ProviderAuthorizationReadiness.lastReportedStatus: only where
  displayedStatus shows nothing, an older `none` or `legacy` decision from
  the live process and the expected coordinator. Built on dev's liveDecision,
  so every guard but the receipt's age stays: the snapshot write within
  10 s, process and coordinator identity, online, protocol 1, a receipt
  after the process started and at most 2 s ahead. An older app_attest or an
  unknown path is never history. lastReportedSummary prefixes the age and
  "not a fresh dispatch grant" to the summary. DaemonState gains
  lastReportedProviderAuthorization, beside displayedProviderAuthorization.
- status prints "Last reported authorization: …" before its trust line;
  doctor's diagnosis and its coordinator checks, and verify, print "last
  reported authorization", INFO for legacy and WARN for none, and the trust
  and public attestation checks still run after it.
- verify exits non-zero on a WARN or FAIL (isFailure(strict: true)), not on
  INFO; no other check is INFO, so only the new legacy line is affected.
- provider-authorization.md and cli-reference.md say so;
  changelog.d/authorization-history.md.

Tests: the CLI tests of the previous commit fail on dev and pass here;
ProviderAuthorizationReadinessTests gains nine tests of the new API (history
only for none and legacy, never for a displayed decision or an aged App
Attest one, and every guard).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 10, 2026 12:22am UTC
darkbloom-status Ready Ready Preview Nov 10, 2026 12:22am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 10, 2026 12:22am UTC

Request Review

… second guard

Independent refactor pass of this port (#1943). No behavior change.

- `buildCoordinatorDoctorChecks` asked for the last reported authorization
  only when no current decision was shown (`authorization == nil ? … : nil`).
  `lastReportedStatus` already returns nil whenever `displayedStatus` shows
  one, and the row is used only below the current decision's early return, so
  the call stays beside the other two decisions from the same snapshot and
  time, without the ternary.
- `lastReportedPaths` is private: only this file reads it.

Local (Xcode 27.2, CPU sandbox): ProviderAuthorizationReadinessTests 23,
DoctorCommandRunTests 14, DoctorOperatorDiagnosisTests and
StatusCommandRunTests 11: pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…report as dated history

The independent review found that two of the four display sites had no test:
with the `status` block and `DoctorRunner`'s trust-section block both removed,
all 25 status and doctor tests still passed.

- `StatusCommandRunTests.agedReportIsDatedHistory`: an aged legacy and an aged
  none report each print `Last reported authorization: received 10m ago; …`
  right before `Trust: self_signed / online`, and no `Authorization:` line;
  the same legacy report received just now prints `Authorization: …` and no
  history.
- `DoctorOperatorDiagnosisTests.agedReportIsTrustHistory`: the diagnosis has a
  `last reported authorization` row in the trust section (INFO for legacy,
  WARN for none, the exact text, no fix) before `trust level`, and no
  `serving authorization`; received just now, it is the serving authorization.

Both reuse `DoctorCommandRunTests`' report fixtures. The diagnosis case runs
without hardware, so no GPU capability probe starts.

Local (Xcode 27.2, CPU sandbox): StatusCommandRunTests 7,
DoctorOperatorDiagnosisTests 6, DoctorCommandRunTests 14: pass. With both
blocks removed, exactly the two new tests fail (3 issues); every other test
passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

3 active deployments
Preview – eigen-homepages-darkbloom — b58b276f Deployed Nov 10, 2026 by vercel[bot]
Preview – d-inference-landing — b58b276f Deployed Nov 10, 2026 by vercel[bot]
Preview – darkbloom-status — b58b276f Deployed Nov 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant